import lejos.nxt.*;
import lejos.robotics.navigation.Pilot;
import lejos.robotics.navigation.TachoPilot;

public class robotTest {
	Pilot pilot;
	
	public static void main(String[] args)
    {
        robotTest sq = new robotTest();
        //sq.pilot = new TachoPilot(2.184f, 4.233f, Motor.A, Motor.C, true);
        sq.pilot = new TachoPilot(5.52012f, 11.14f, Motor.A, Motor.C, true);
        
        
        sq.drive80Cm();
        //sq.testTravel();
        //sq.testForward();
        
    }
	
	private void drive80Cm(){
		//pilot.travel(80);
		pilot.setTurnSpeed(30);
		pilot.rotate(360);
		
	}
	
	public void testTravel(){
		pilot.travel(200, true);
		try {
			Thread.sleep(2000);
		} catch (InterruptedException e) {
			// TODO Auto-generated catch block
			System.out.println(e.toString());
		}
		pilot.stop();
		System.out.println("end travel");
	}
	
	public void testForward(){
		System.out.println("start forward");
		MoveForward fwThread = new MoveForward();
		fwThread.p = pilot;
		Thread test = new Thread(fwThread);
		test.start();
		
		System.out.println("end forward");
		
		
	}
}

class MoveForward implements Runnable{
	Pilot p;
	boolean forward = true;
	@Override
	public void run() {
		while(forward){
			p.forward();
		}
		
	}
	

}

